home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Diamond Collection
/
The Diamond Collection (Software Vault)(Digital Impact).ISO
/
cdr36
/
sqbe_d.zip
/
QBE.DOC
< prev
next >
Wrap
Text File
|
1995-02-07
|
58KB
|
1,500 lines
===================
S U P E R Q B E
===================
The Super Query By Example Templates
Version 1.0
for
Clarion for Windows
(c) Copyright 1995 - BoxSoft Development Inc. -----------------
Table of Contents
-----------------
Introduction .......................... -1-
Installation .......................... -2-
Distributing Your Applications ............... -2-
What is Query By Example? .................... -3-
What are Tags? ......................... -5-
Adding QBE to Your Application ................. -6-
Registering the Template .................. -6-
Global Support ....................... -6-
Browse Support ....................... -8-
Form Support ........................ -9-
Optional Tag Filters in a Browse .............. -11-
Filtering Tagged in Reports and Processes ......... -13-
Showing Only Tagged Records in a Browse .......... -15-
Showing Only Tagged Records in Reports and Processes .... -16-
Reference Section ........................ -17-
Embed Points in QbeForm .................. -17-
Global Variables ...................... -18-
Procedures and Functions using POINTER ........... -19-
Procedures and Functions using POSITION .......... -21-
Miscellaneous Procedures and Functions ........... -23-
Contacting Technical Support .................. -24-
-----------------
MAJOR WARNING !!!
-----------------
It is very important that you read this manual. If you follow the
instructions step-by-step, then the usage is very simple. It is
almost IMPOSSIBLE if you try to do it on your own!
----------
Disclaimer
----------
This software is guaranteed to occupy space. BoxSoft Development Inc.
offers no other warranties as to its usability or usefulness. If you
have difficulty with the software, we promise to help you as much as
we deem is necessary and possible. We are not liable for any losses
of time or money that you may experience due to this software or its
use. ------------
Introduction
------------
The SuperQBE Templates enable you to perform ad hoc query operations
using Clarion for Windows. This will save you from writing numerous
reports for your users. Instead, they can perform a wide variety of
searches using their regular forms, then print the results using one
of their standard reports.
There are a number of templates included in this package to provide
you with the following functionality:
QbeBrowse - This Control template calls a Form procedure for a query
operation. After the form returns, it automatically displays
only the search results in your browse (assuming that you are
also using the BrowseOptTagFilter).
QbeForm - This Control template is placed on your Form. It performs
the majority of the searching operations and interface control.
It can tag all matching records, or display each record for you
optionally to edit it.
BrowseOptTagFilter - This Control template provides a button that
toggles a Browse between showing "All" records, or just "Tagged"
records. It is automatically utilized by the QbeBrowse template.
BrowseTagFilter - This Extension template enables you to display only
tagged records in a browse. This differs from the previous
template in that the filter is always "on".
ProcessTagFilter - This Extension template adds a filter to a Report
or Process so that only tagged records are used by the procedure.
This is similar to the BrowseTagFilter template, except that it
is specifically used for Report and Process procedures, rather
than BrowseBox windows.
When records are selected by the QBE system, they are "tagged". Tags
may be stored in a "TagFile_ using POINTER", "TagFilePos_ using
POSITION" (for file drivers that do not support record numbers), or in
a "BYTE Field in Primary" file of the parent BrowseBox.
-1- ------------
Installation
------------
Whether you've received a diskette or downloaded the file from our
BBS, Compuserve or any other electronic forum, the installation
process is the same. Execute the command:
install <source> <target> <password>
install a:\ c:\cw password ie:
<source> This is the source directory containing the file
ZIPPED.EXE. It will normally be A:\, or C:\DOWNLOAD,
or something like that.
<target> This is the destination, and will normally be your
C:\CW directory. The installation program will place a
one or more DLLs into your C:\CW\BIN directory.
<password> This is the password that you got from BoxSoft or
Mitten. It should be displayed on your invoice, or you
can call Mitten for the password. Make sure you type
it in lower case!
You should see the following structure under your CW directory:
C:\CW
+-SUPER QBE.TPL
| +-DOC QBE.DOC
| +-EXAMPLES
| | `-QBE QBE Example
| +-INCLUDE S_QBEEQU.CLW, S_TAG???.CLW
| +-LIB S_TAGLIB.LIB
| `-LIBSRC
| `-TAGGING Tagging Library Source Code
`-BIN S_TAGLIB.DLL
After the files are installed, you must update your Redirection file
to add the C:\CW\SUPER\INCLUDE directory to your CLW entry, and the
C:\CW\SUPER\LIB directory to your LIB entry. You can do this using
the "Setup / Edit Redirection File" pulldown menu option. The OBJ and
LIB entries should look like this:
*.lib = c:\cw\obj;c:\cw\lib;c:\cw\super\lib
*.clw = .;c:\cw\source;c:\cw\super\include
Distributing Your Applications
------------------------------
When ship your applications to users, make sure that you include a
copy of the S_TAGLIB.DLL file from your C:\CW\BIN directory.
-2- -------------------------
What is Query By Example?
-------------------------
Query By Example, or "QBE", is used to perform ad hoc searches for
records in your data files. It uses a regular Form to input the
search criteria. The query results can be edited, or selected for
subsequent tagging operations. You can use a variety of comparison
operators on each field, including "exact match", "doesn't equal
this", "contains this", "doesn't contain this", "begins with this",
"ends with this", etc.
Normally a QBE Form is called from a QBE button on a Browse, although
it can be called from your own hand-coded procedures. (Just set
GlobalRequest=QbeAction before calling the Form.) The QBE button on
the browse usually has display text of "Search". This button is
populated onto the Browse using the QbeBrowse Control template.
The Form must have the QbeForm Control template. This creates two
buttons: "Search Type" and "Begin Search". Depending on the type of
entry field, a different default comparison operator (Search Type) is
assumed. The default is "begins with" for a string field, "equals
this" for a number field, etc.
SuperQBE for CW is much more flexible that our CDD product. You have
control of the defaults for String, Number, Picture, Date, Option,
Check, and Text fields. You can modify these defaults in the template
settings.
If the user wishes to override this default for a given field, they
must press the "Search Type" button to see a list of possible
comparison types. This list is context sensitive: it displays only
the applicable comparison types for the datatype of the current field.
There is a corresponding one character "flag" to represent each of the
comparison operators. The appropriate flag will appear in the
position immediately preceding the field, so you should make sure that
the field isn't positioned closely after another field or PROMPT().
If it is, the existing controls will be overlayed by the comparison
flags. You can change the strings that are displayed using the global
prompts. Some of the flags use the Symbol font, while others use the
System font. You must make sure that these fonts are on your users'
systems.
If the user enters more than one field in the form, the comparisons
are joined in a boolean "AND" operation. For example, if the user
specifies a last name of "Smith", a city of "Toronto", and a salary of
more than "$50000", they will get only those records matching all
three of those criteria. We will be adding the option for multiple
criteria values per field in a future version. This would allow "OR"
operations like: records where the last name is "Smith" or "Jones",
and they live in "Toronto" and ...
Once they have finished entering the criteria, they can push the
"Begin Search" button, then choose to edit the results, or to select
all matching records. This will actually vary depending on how you've
-3- set up the prompts. (For the time being, we'll assume that all
options are enabled.)
If the user chooses to "Edit" the records, each matching record will
be displayed in the form. The "Search Type" button is changed to
"Edit This", while the "Begin Search" button is changed to "Find
Next". The "Cancel" button can be used to abort the search. Once
they've accepted the first record they are immediately placed into
edit mode so that they can make any desired changes. After finishing
the update, the form immediately returns to the calling procedure.
If you have turned on the "Select Support", and if the user chooses to
"Select" the records, then all matching entries will be tagged. You
can use the BrowseOptTagFilter, BrowseTagFilter, and ProcessTagFilter
templates to restrict which records are available. If you have our
SuperTagging templates, you can also modify the selections using those
tagging features. Make sure that all of the associated procedures use
the same tag storage settings.
If there are already tagged records from a previous search, then the
user will be given an additional option of "Untagging". This will
limit the search only to the previously-tagged records. This is handy
if you want to find a bunch of records with one operation, then
selectively remove a few with a series of untag operations.
For example, you may want to determine all people from Toronto who
don't live in an apartment. You would first select all people who
live in Toronto. Then you would perform a second query to unselect
those with "APT" in their address. Then those with "SUITE", "STE",
etc.
If there are previous tags but the user chooses to Select the records,
they will be given the option to clear the previous selections first.
Depending on the type of data in your file, they may have handled the
"people in Toronto not in an apartment" example differently. Rather
than performing a Select followed by various Unselects, they could
have done multiple Select operations. The first would get all people
in Toronto where the address didn't contain "APT". Each subsequent
search operation could add to the previous search's results.
When searching for matching records, the system automatically uses
keys to optimize the operation. First it checks the key specified in
your file schematic (if it exists). Then it checks each key in the
order in which it appears in the file definition. If the first field
in the key is specified in the criteria with an appropriate comparison
operator, it will use the key.
Valid comparison operators include "exact match", "begins with", "in
range", "more than", "less than", "more than or equal", and "less than
or equal". With this in mind, you may want to reorganize the keys in
your datafiles to optimize your searches. For example, if you
anticipate that the user will perform many searches involving salary
ranges, then you might make the first key in your file based upon the
salary field.
-4- --------------
What are Tags?
--------------
Tags are "flags" on a record that indicate that they've been marked
for a special purpose. There are three ways that tags can be stored
in the BoxSoft SuperTagging and SuperQBE templates:
TagFile_ (POINTER)
------------------
This is the suggested method for storing tags, whenever possible.
TagFile_ is a separate file using the TopSpeed file driver. Each
record contains the user number, tag set number, record pointer, and
sorting value. This enables you to have multiple users tagging
records in the file at the same time. Or a single user could create
multiple tag sets for the same file (ie: one for billing and another
for advertising). There are three disadvantages to this method:
1. Because it is creating tags in a separate file, it is sometimes
slower than storing the tags in the primary data file itself.
2. The TagFile_ records are not relationally linked to the original
data file. This means that you could delete a data record, and
have a tag hanging around. (We will be addressing this issue in
an upcoming version.)
3. You can process the tags very quickly, but you don't have very
much control of the order in which the tags are processed. There
is a field in the tag file called "Val" which stores a 10
character value that is used to control the ordering. The
template decides which is the best field to use for this value.
TagFilePos_ (POSITION)
----------------------
Some file drivers do not support "record numbers", which means that
the POINTER function used with "TagFile_ (POSITION)" will not work.
The most notable of these are the SQL drivers, which are tied to a
primary key value, rather than a record pointer. For these files, we
offer the TagFilePos_ alternative. It is identical to the previous
method, except that it use POSITION instead of POINTER. Because of
this, it is marginally slower. Other than that, it is has the same
pros and cons.
BYTE Field in Primary
---------------------
You can also store the tags by toggling a BYTE field in your data
file. This has the benefit of being faster (if your records are not
too large), and you can use this field to index reports and processes.
Unfortunately, it does not accommodate multi-user operations. Multi-
Tag Sets can be accommodated by using multiple fields in the file.
-5- ------------------------------
Adding QBE to Your Application
------------------------------
Registering the Template
------------------------
CW allows you to have multiple template sets accessible in the same
application. It does this with the Template Registry. To use the
SuperQBE template, you must register it first.
1. Load CW, then select the "Setup / Template Registry" pulldown
menu option.
2. Press the "Register" button.
3. Select "C:\CW\SUPER\QBE.TPL". (The directory name may not
exactly match your system.)
Global Support
--------------
To use the QBE features, you must add the global support to your
application. This is necessary because of a bug in CW 1.000. With
future batches of CW, this will become easier.
1. Load your application.
2. Press the "Global" button on the "Application Tree" window.
3. Press the "Embed" button on the "Global Properties" window.
4. Highlight "Inside the Global Map", then press the "Add" button.
5. Locate "Class SuperQBE", then "GlobalMap" below that. Highlight
this option and press the "Select" button. There are a number of
prompts in this template:
a) "Support Select using the Tagging Library". This controls
whether the tagging support library is included in the
global MAP. If you want to select records without using a
Flag field in your file, then you will need leave this on.
b) "Job Selection Window". This controls what the user sees
when they press the "Begin Search" button.
i) You can decide whether to support the Edit option, or
whether Select/Unselect will be sufficient. If your
user needs QBE for generating reports rather than as an
intelligent record finder, then you may want to turn
this off. Turning this off will disable various
options below.
-6- ii) "Place Edit buttons before Select buttons". If you
want the order on the Qbe Job window as "Edit / Select
/ Unselect / Cancel", then turn this on. If, instead,
you prefer "Select / Unselect / Edit / Cancel", then
turn it off.
iii) The "Title" field is displayed at the top of the Qbe
Job window.
iv) The next four options are for the button text. If
there are not any records currently selected, then the
"Unselect" button will not appear.
c) The "Upper Limit Window" settings control the appearance of
your entry window. You will only see this if you choose the
"Inside Range" or "Outside Range" comparison operators.
The "Match Type Window" settings control the text that will d)
appear when the user is choosing a comparison operator.
Within this, the "Data Type Titles" button leads to the
window titles for different data types. The "Buttons"
button leads you to the text settings for "OK" and "Cancel".
The Match Type window automatically adjusts itself for the
size of the text that you specify.
The "Match Type Flags" are the characters that are displayed e)
in front of your fields for different comparison operators.
If you are not happy with our choice of characters, you can
change them here. You'll notice that the most of the
operators use the "Symbol" font, while the Date operators
use the "System" font. This was a design decision. If you
wish to control the font for each operator, then let us
know; then we can add it to a future version.
6. Highlight the "Global Data" embed entry, then press the "Add"
button.
7. Locate "Class SuperQBE", then "GlobalData" below that. Highlight
this option and press the "Select" button.
a) "Support Select using the Tagging Library". This controls
whether the tagging library's data references are included
in the Global Data area. If you want to select records
without using a Flag field in your file, then you will need
leave this on.
8. Press the "Close" button on the "Embedded Source" window.
9. Press "OK" on the "Global Properties" window.
-7- Browse Support
--------------
Normally you will be performing QBE operations by calling a Form from
a Browse. First you have to add the QbeBrowse Control template to
your Browse screen.
1. Press the "Window" button on the "Procedure Properties" screen.
2. Arrange for a bit of space of your screen in which to place the
button.
3. Press the "TPL" button on the "Controls" Toolbox, or select the
"Populate / Control Template..." option from the pulldown menu.
4. Locate "Class SuperQBE", then "QbeBrowse" below that. Highlight
this option and press the "Select" button.
5. As you move your cursor across your window structure, you will
notice the cursor changes to the "Populate Crosshairs". Place
the cursor in the empty area, then click the left mouse button.
6. Adjust the size and position of the button as desired. You can
change the button's text if it doesn't suit your situation. Then
click the "OK" button to save the window structure.
7. Click the "Controls" button, highlight the "QBE Browse Control",
then press the "Properties" button.
8. The "Form Procedure" is the form that is called to perform the
search operation. Normally this will be the same as your Update
Procedure.
9. The next setting is "Show only selected after successful search".
It controls how the system behaves after your form has returned
to the Browse. If this option is on, then the template will
attempt to find a "BrowseOptTagFilter" Control template to
display only tagged records. If this prompt is turned off, or if
you do not have the BrowseOptTagFilter template populated onto
the Browse, then the browse will always show all records.
-8- Form Support
------------
This is where the bulk of the query operation is performed. The
QbeForm Control template handles the user interface for entering the
search criteria, as well as performing the searching operations.
There are a large number of settings to control the behaviour of the
system.
1. Press the "Window" button on the "Procedure Properties" screen.
2. Arrange for a bit of space of your screen in which to place the
two buttons.
3. Press the "TPL" button on the "Controls" Toolbox, or select the
"Populate / Control Template..." option from the pulldown menu.
4. Locate "Class SuperQBE", then "QbeForm" below that. Highlight
this option and press the "Select" button.
5. As you move your cursor across your window structure, you will
notice the cursor changes to the "Populate Crosshairs". Place
the cursor in the empty area, then click the left mouse button.
6. Adjust the size and position of the button as desired. You can
change the button's text if it doesn't suit your situation. Then
click the "OK" button to save the window structure.
7. Click the "Controls" button, highlight the "QBE Form Control",
then press the "Properties" button.
8. The first setting is "Buttons Unavailable". This controls the
appearance of the two QBE buttons during normal editing
operations. The default is "HIDE", altough you may want to
change it to "DISABLE".
9. The next setting is "Alternate Update Proc". This is used when
you want this procedure to perform only searches, while another
procedure performs the actual edits to the file. If you specify
this setting, it will call the alternate update procedure in two
situations:
a) The form is called with GlobalRequest <> QbeAction.
b) The user chooses to edit a record during the search.
10. The "'Select Records' Support" controls whether the user is
allowed to select records, and how those selections are stored.
The first setting under this button controls whether a)
selections are allowed at all. If you turn this off, the
rest of the screen will be disabled.
The next setting controls where tags are stored. This can b)
be "TagFile_ (POINTER)", "TagFilePos_ (POSITION)", or "BYTE
Field in Primary". See the "What are Tags?" section earlier
-9- in the manual for the pros and cons of each of these
methods.
c) If you chose TagFile_ or TagFilePos_ for the previous
option, you must specify a tag set number.
d) If you chose "BYTE Field" in the previous option, you must
specify a field from your file.
11. The "Miscellaneous Messages" button leads to a series of system
messages:
"Enter Search Criteria (ActionMessage)". This is the a)
message that is displayed in your ActionMessage field during
the QBE criteria entry.
"Select field before hitting Search Type". The user must be b)
sitting in a data field before hitting the "Search Type"
button. Otherwise, the system doesn't know what field you
are working with.
"Clear old selections first?". This question is presented c)
to the user if they decide to tag the query results but
there are existing tags present.
"There are no matching records". This message is displayed d)
if there are no matching records. This will only appear
when the system is search for the first matching record.
"There are no more matching records". This message is e)
different from the previous entry in that it is called after
all records have been rejected during an "Edit" search.
"You must specify at least one search field". You cannot f)
perform a "blank" query. This message appears if the user
attempts to do so.
g) "Edit This Record?". These last three settings control the
appearance of the ActionMessage and QBE Buttons during the
"Ask Edit" operation.
12. The "Progress Window" settings control what text is displayed on
the Progress screen.
13. The "Default Match Types" button leads to the default settings
for the different datatypes. For example, you can individually
control the default comparison type for String, Number, Picture,
Date, Check, Option, and Text fields.
-10- Optional Tag Filters in a Browse
--------------------------------
Your users may wish to toggle between viewing "all records" and "only
tagged records". The "BrowseOptTagFilter" Control template is
designed with this goal in mind. It is populated onto the browse
window as a button that changes it's text depending on the current
viewing state.
The QbeBrowse template will make use of this template to display only
selected records.
Here's how you use the template:
1. Press the "Window" button on the "Procedure Properties" screen.
2. Arrange for a bit of space of your screen in which to place the
button. If you have a group box around your tagging buttons,
then you may want to expand that group to place the new button
below.
3. Press the "TPL" button on the "Controls" Toolbox, or select the
"Populate / Control Template..." option from the pulldown menu.
4. Locate "Class SuperQBE", then "BrowseOptTagFilter" below that.
Highlight this option and press the "Select" button.
5. As you move your cursor across your window structure, you will
notice the cursor changes to the "Populate Crosshairs". Place
the cursor in the empty area, then click the left mouse button.
6. Adjust the size and position of the button as desired. Don't
worry about the button's text, as this is controlled by the
template prompts. Then click the "OK" button to save the window
structure.
7. Click the "Controls" button, highlight the "Optionally Filter
Tagged Records", then press the "Properties" button.
8. The first group is "Tag Storage". Here you can specify the
location of the tags. Your options are:
TagFile_ (POINTER) - This method will cause tags to be stored in
a separate data file called TAGFILE_.TPS. This is the
preferred method, as it provides the most flexibility, with
the best speed.
TagFilePos_ (POSITION) - This is similar to the prior method,
except it is necessary when your data file driver doesn't
support record numbers (ie: SQL). It is slightly slower.
BYTE Field in Primary - Using this method, all tags will be
stored as a True/False field in your file.
9a. If you choose either of the "TagFile" options, you will be asked
for a Tag Set Number or Equate. This can be a constant (ie: 1),
-11- an equate (ie: eT_Customer), or a variable (ie: Loc:TodaysTags).
At the very least, you should have a different Tag Set for each
data file; otherwise, there is a very good chance that your tag
sets will corrupt each other. This field is required.
9b. If you choose "BYTE Field", you will be asked for the name of a
field in your BrowseBox's primary file. This doesn't have to be
a BYTE field (any numeric field will do), but it makes the most
sense to save space.
10. The "Button Text" group controls the text that the user will see
on the button. The "Show Tagged" message is displayed in the
button when they are viewing all records. By pressing the
button, it will change the the "Show All" text, and they will be
viewing only tagged entries. In each of these cases, you can
include an ampersand (&) to control the "hot key" for the button.
The final option is a drop box controlling the initial state when
the user enters the browse. The default for this is "Show All".
11. Press "OK" to save the "Prompts for BrowseOptTagFilter", "OK"
again to exit the "Edit Control Templates" window, and "OK" again
to save the "Procedure Properties".
12. Test you application.
-12- Filtering Tagged in Reports and Processes
-----------------------------------------
Your users may wish to toggle between viewing "all records" and "only
tagged records". The "BrowseOptTagFilter" Control template is
designed with this goal in mind. It is populated onto the browse
window as a button that changes it's text depending on the current
viewing state. Here's how you do it:
1. Press the "Window" button on the "Procedure Properties" screen.
2. Arrange for a bit of space of your screen in which to place the
button. If you have a group box around your tagging buttons,
then you may want to expand that group to place the new button
below.
3. Press the "TPL" button on the "Controls" Toolbox, or select the
"Populate / Control Template..." option from the pulldown menu.
4. Locate "Class SuperQBE", then "BrowseOptTagFilter" below that.
Highlight this option and press the "Select" button.
5. As you move your cursor across your window structure, you will
notice the cursor changes to the "Populate Crosshairs". Place
the cursor in the empty area, then click the left mouse button.
6. Adjust the size and position of the button as desired. Don't
worry about the button's text, as this is controlled by the
template prompts. Then click the "OK" button to save the window
structure.
7. Click the "Controls" button, highlight the "Optionally Filter
Tagged Records", then press the "Properties" button.
8. The first group is "Tag Storage". Here you can specify the
location of the tags. Your options are:
TagFile_ (POINTER) - This method will cause tags to be stored in
a separate data file called TAGFILE_.TPS. This is the
preferred method, as it provides the most flexibility, with
the best speed.
TagFilePos_ (POSITION) - This is similar to the prior method,
except it is necessary when your data file driver doesn't
support record numbers (ie: SQL). It is slightly slower.
BYTE Field in Primary - Using this method, all tags will be
stored as a True/False field in your file.
9a. If you choose either of the "TagFile" options, you will be asked
for a Tag Set Number or Equate. This can be a constant (ie: 1),
an equate (ie: eT_Customer), or a variable (ie: Loc:TodaysTags).
At the very least, you should have a different Tag Set for each
data file; otherwise, there is a very good chance that your tag
sets will corrupt each other. This field is required.
-13- 9b. If you choose "BYTE Field", you will be asked for the name of a
field in your BrowseBox's primary file. This doesn't have to be
a BYTE field (any numeric field will do), but it makes the most
sense to save space.
10. The "Button Text" group controls the text that the user will see
on the button. The "Show Tagged" message is displayed in the
button when they are viewing all records. By pressing the
button, it will change the the "Show All" text, and they will be
viewing only tagged entries. In each of these cases, you can
include an ampersand (&) to control the "hot key" for the button.
The final option is a drop box controlling the initial state when
the user enters the browse. The default for this is "Show All".
11. Press "OK" to save the "Prompts for BrowseOptTagFilter", "OK"
again to exit the "Edit Control Templates" window, and "OK" again
to save the "Procedure Properties".
12. Test you application.
-14- Showing Only Tagged Records in a Browse
---------------------------------------
This Extension template is similar to the "BrowseOptTagFilter" control
template. It is used to display only tagged records on a Browse. The
only difference is that this template has a fixed filter, rather than
giving the user the option of toggle between filtered and non-
filtered. Accomplishing this is very simple:
1. This procedure can only be used with a procedure that already
contains a BrowseBox. Get into the "Procedure Properties" screen
for your Browse, then press the "Extensions" button.
2. Press the "Add" button in the "Select Extension" window.
3. Locate the "Class SuperQBE", highlight "BrowseTagFilter" below
that, then press the "Select" button.
4. You will see the same storage options as were described in the
BrowseTaggingButtons section earlier. Make sure that you specify
the same settings here as you did in your original tagging
Browse. Otherwise, the tagged records will not be found.
5. Press "OK" in the "Prompts for BrowseTagFilter" window to return
to the "Edit Extensions" window. Don't be alarmed when you
discover that your new extension has disappeared! This is a bug
in Clarion. Because this extension template is associated with a
control template, it has moved to the Controls window. Press
"OK" to exit the "Edit Extensions" window. You'll also notice
that there is a checkmark beside the "Extensions" button, even
though there is nothing in the window.
6. Press the "Controls" button on the "Procedure Properties" window,
highlight the "Filter Tagged Records" entry, then press the
"Properties" button. Here are your settings.
7. Press three "OK" buttons, then test your application.
Of course, if your browse used "BYTE Field in Primary" as its tag
storage method, then you don't need to use this extension. Instead,
you could use a key on the tag field to make the Browse very fast.
This is not really necessary unless you have many records in your
file. We'll leave that up to your personal preference.
If you need to delete this extension, you must press the "Window"
button, then select the "Edit / Control Templates..." pulldown menu
option. You may highlight the template and press the "Delete" button
here. At this time, this is only way to delete an Extension that
connected to a Control.
-15- Showing Only Tagged Records in Reports and Processes
----------------------------------------------------
Once your user has tagged records, he will want to do something when
them. The most common request is to print only tagged records in a
report. Or they may want to delete the tagged records using a Process
procedure. Accomplishing this is very simple:
1. Get into the "Procedure Properties" screen for your Report or
Process, press the "Extensions" button.
2. Press the "Add" button in the "Select Extension" window.
3. Locate the "Class SuperQBE", highlight the "ProcessTagFilter"
below that, then press the "Select" button.
4. You will see the same storage options as were described in the
BrowseTaggingButtons section earlier. Make sure that you specify
the same settings here as you did in your Browse. Otherwise, the
tagged records will not be found.
5. Save the process and test your APP.
Of course, if your browse used "BYTE Field in Primary" as its tag
storage method, then you don't need to use this extension. Instead,
you could use a key on the tag field to speed up the report. We'll
leave that up to your personal preference.
-16- -----------------
Reference Section
-----------------
Embed Points in QbeForm
-----------------------
The QbeForm template creates its own ACCEPT loop for entering the QBE
criteria. This means that none of your regular EVENT, SELECTED and
ACCEPTED embed points will be included during the criteria entry
stage. This is normally not a problem. If, however, you wish to
tweak the QBE operation, you'll find the following embed points for
your use:
QBE: Before Opening the Window - This is executed before the
OPEN(%Window) statement.
QBE: After Opening the Window - This is executed after the
OPEN(%Window) statement. The system has already hidden all of
the non-QBE controls and created all of the Match Type flags.
QBE: Preparing to Process the Window - This occurs immediately before
the ACCEPT loop.
QBE: Accept Loop, Before CASE EVENT() handling - This occurs
immediately inside the ACCEPT loop.
QBE: Accept Loop, After CASE FIELD() handling - This occurs at the
bottom of the ACCEPT loop, after the built-in EVENT() and FIELD()
processing.
If you wish to perform event processing, then you must write the case
structures yourself. The basic for is:
CASE EVENT()
OF EVENT:Selected
CASE SELECTED()
OF ?YourField
DO Something
END
OF EVENT:Accepted
CASE ACCEPTED()
OF ?YourField
DO SomethingElse
END
OF EVENT:Timer
DO TimerCode
END
There is one final embed: Hidden QBE Criteria. In some situations,
your QBE operation must search within a standard set of records. For
example, you might restrict the searches to transactions from this
year, or to records assigned to the current user. You don't want to
force the user to enter this criteria each time. In the case of user-
specific records, there may be security issues involved. This embed
-17- point is designed to handle this problem. You can add as many hidden
criteria as you need. The code will look something like this:
IF NOT Condition THEN EXIT.
IF YEAR(Inv:Date) <> YEAR(TODAY()) THEN EXIT.
IF Cus:UserNo <> UserNo_ THEN EXIT.
Global Variables
----------------
If you wish to override the default for these variables, you should do
it in the "Setup Program" global embed.
TagFile::Name This contains the name of the TagFile used for
tagging with the POINTER function. The default is
"TAGFILE_.TPS".
TagFilePos::Name This contains the name of the TagFile used for
tagging with the POSITION function. The default
is "TAGFILEP.TPS".
TagFile::Access This is the access mode used to open the POINTER
tag file. The default is 42h, which is the
standard "sharing" mode. If your application is
single-user, then you can change this to 22h. We
have found that using 42h keeps the application
acceptably quick using the TopSpeed file driver.
TagFilePos::Access This is the same as TagFile::Access, except for
the POSITION library.
TagFile::Used This is equivalent to the "Filename::Used"
variables that are generated for each of your
application's data files. It is incremented each
time the TagFile_ is opened, and decremented with
the process is finished.
TagFilePos::Used This is the same as "TagFile::Used", except for
the TagFilePos_ file.
UserNo_ This global variable is actually populated
directly into your global data variables. It is
used by the tagging system to support multi-user
operations. It is also used by the BoxSoft
SuperSecurity Template. If you are not using the
BoxSoft security features, then you can set this
variable to match your user number before
beginning any tagging operations.
-18- Procedures and Functions using POINTER
--------------------------------------
If you are using the "TagFile_ (POINTER)" storage method, then the
following procedures and functions apply:
NewTag_ This procedure clears all tags for a specified tag set.
The format of its call is:
NewTag_(<tag set>)
CntTag_ This function returns the number of tags in the
specified tag set. The format of its call is:
Result# = CntTag_(<tag set>)
GetTag_ This function returns either 1 or 0, depending on
whether the requested record is tagged. The format of
its call is:
Result# = GetTag_(<tag set>, <record pointer>)
IF GetTag_(1,POINTER(Customer)) ie:
DO Process
END
SetTag_ This procedure is used to set a tag for a particular
tag set and record pointer. There is an optional Value
parameter, for storing the tags in a particular order
for FstTag_/NxtTag_ processing. The format of its call
is:
SetTag_(<tag set>, <record pointer>, <value>)
ie: SetTag_(1,POINTER(Product))
SetTag_(1,POINTER(Customer),Cst:LName) ie:
ClrTag_ This procedure is used to clear a tag for a particular
tag set and record pointer. The format of its call is:
ClrTag_(<tag set>, <record pointer>, <value>)
ie: ClrTag_(1,POINTER(Customer))
-19- RvsTag_ This procedure is used to reverse a tag for a
particular tag set and record pointer. That is, if the
tag is set before the call to RvsTag_ it will be
cleared, and vice versa. There is an optional Value
parameter, for storing the tags in a particular order
for FstTag_/NxtTag_ processing. The format of its call
is:
RvsTag_(<tag set>, <record pointer>, <value>)
RvsTag_(1,POINTER(Product)) ie:
RvsTag_(1,POINTER(Customer),Cst:LName)
FstTag_ This function returns a pointer to the first tagged
record in the specified tag set. If there are no
records in the specified tag set, the function returns
zero. It processes the tags in TF_:ValKey order, which
is usually the order of the original browse or order
that the records were tagged.
There are a number of situations where you would use
FstTag_(). You may want to check if there are any
tagged records available. You would also use FstTag_()
in conjunction with NxtTag_() to process all tagged
records. The format of its call is:
Result# = FstTag_(<tag set>)
NxtTag_ This function returns a pointer to the next tagged
record in the specified tag set. FstTag_() must be
called first for this function to work. If there are
no more records, the function returns zero. The format
of its call is:
Result# = NxtTag_(<tag set>)
LstTag_ This function returns a pointer to the last tagged
record in the specified tag set. If there are no
records in the specified tag set, the function returns
zero. It processes the tags in reverse TF_:ValKey
order
There are a number of situations where you would use
LstTag_(). You may want to check if there are any
tagged records available. You would also use LstTag_()
in conjunction with PrvTag_() to process all tagged
records. The format of its call is:
Result# = LstTag_(<tag set>)
-20- PrvTag_ This function returns a pointer to the next tagged
record in the specified tag set. LstTag_() must be
called first for this function to work. If there are
no more records, the function returns zero. The format
of its call is:
Result# = PrvTag_(<tag set>)
Procedures and Functions using POSITION
---------------------------------------
If you are using the "TagFilePos_ (POSITION)" storage method, then the
following procedures and functions apply:
NewTagPos_ This procedure clears all tags for a specified tag set.
The format of its call is:
NewTagPos_(<tag set>)
CntTagPos_ This function returns the number of tags in the
specified tag set. The format of its call is:
Result# = CntTagPos_(<tag set>)
GetTagPos_ This function returns either 1 or 0, depending on
whether the requested record is tagged. The format of
its call is:
Result# = GetTag_(<tag set>, <record position>)
ie: IF GetTagPos_(1,POSITION(Customer))
DO Process
END
SetTagPos_ This procedure is used to set a tag for a particular
tag set and record position. There is an optional
Value parameter, for storing the tags in a particular
order for FstTagPos_/NxtTagPos_ processing. The format
of its call is:
SetTagPos_(<tag set>, <record position>, <value>)
SetTagPos_(1,POSITION(Product)) ie:
SetTagPos_(1,POSITION(Customer),Cst:LName) ie:
ClrTagPos_ This procedure is used to clear a tag for a particular
tag set and record position. The format of its call
is:
ClrTagPos_(<tag set>, <record position>, <value>)
ie: ClrTagPos_(1,POSITION(Customer))
-21- RvsTagPos_ This procedure is used to reverse a tag for a
particular tag set and record position. That is, if
the tag is set before the call to RvsTagPos_ it will be
cleared, and vice versa. There is an optional Value
parameter, for storing the tags in a particular order
for FstTagPos_/NxtTagPos_ processing. The format of
its call is:
RvsTagPos_(<tag set>, <record position>, <value>)
RvsTagPos_(1,POSITION(Product)) ie:
RvsTagPos_(1,POSITION(Customer),Cst:LName)
FstTagPos_ This function returns the position of the first tagged
record in the specified tag set. If there are no
records in the specified tag set, the function returns
an empty string (''). It processes the tags in
TP_:ValKey order, which is usually the order of the
original browse or order that the records were tagged.
There are a number of situations where you would use
FstTagPos_(). You may want to check if there are any
tagged records available. You would also use
FstTagPos_() in conjunction with NxtTagPos_() to
process all tagged records. The format of its call is:
Result" = FstTagPos_(<tag set>)
NxtTagPos_ This function returns the position of the next tagged
record in the specified tag set. FstTagPos_() must be
called first for this function to work. If there are
no more records, the function returns an empty string
(''). The format of its call is:
Result" = NxtTagPos_(<tag set>)
LstTagPos_ This function returns the position of the last tagged
record in the specified tag set. If there are no
records in the specified tag set, the function returns
an empty string (''). It processes the tags in reverse
TP_:ValKey order
There are a number of situations where you would use
LstTagPos_(). You may want to check if there are any
tagged records available. You would also use
LstTagPos_() in conjunction with PrvTagPos_() to
process all tagged records. The format of its call is:
Result" = LstTagPos_(<tag set>)
-22- PrvTagPos_ This function returns the position of the next tagged
record in the specified tag set. LstTagPos_() must be
called first for this function to work. If there are
no more records, the function returns an empty string
(''). The format of its call is:
Result" = PrvTagPos_(<tag set>)
Miscellaneous Procedures and Functions
--------------------------------------
UsrTag_ This procedure is used to set the pointer to the global
UserNo_ variable. This variable is shared by the
BoxSoft SuperSecurity Templates so that your tagging
operations are automatically multi-user when using the
security system.
-23- ----------------------------
Contacting Technical Support
----------------------------
If you have any troubles with this product, then please contact:
Mitten Software
10709 Wayzata Blvd
Minnetonka, MN 55305
Voice : (612) 593-5019
Fax : (612) 593-5028
BBS : (612) 593-1050
CIS : Mike Hanson [73234,1447]
Internet : 73234.1447@compuserve.com
-24-